← Back to issue list

Core24 accepts integer version, Core22 does not and gives obscure error

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#2081962
Type
issue
State
open
Author
~nteodosio
Labels
Created
2024-09-25 09:17:37.666166+00:00
Updated
2024-11-07 18:13:45.960943+00:00
Closed

Current evaluation

No evaluation has been recorded for this issue yet.

Issue body

I had this snapcraft.yaml, which built fine: ---> name: llvm-chromium version: 20 base: core24 ... <--- Changing base to core22 causes the very same build to fail right away, which is already confusing enough, but then the error is also cryptic: ---> Traceback (most recent call last): File "/snap/snapcraft/12614/bin/snapcraft", line 8, in <module> sys.exit(main()) File "/snap/snapcraft/12614/lib/python3.10/site-packages/snapcraft/application.py", line 498, in main return cli.run() File "/snap/snapcraft/12614/lib/python3.10/site-packages/snapcraft/cli.py", line 252, in run _run_dispatcher(dispatcher, global_args) File "/snap/snapcraft/12614/lib/python3.10/site-packages/snapcraft/cli.py", line 225, in _run_dispatcher dispatcher.run() File "/snap/snapcraft/12614/lib/python3.10/site-packages/craft_cli/dispatcher.py", line 487, in run return self._loaded_command.run(self._parsed_command_args) File "/snap/snapcraft/12614/lib/python3.10/site-packages/snapcraft/commands/core22/lifecycle.py", line 139, in run parts_lifecycle.run(self.name, parsed_args) File "/snap/snapcraft/12614/lib/python3.10/site-packages/snapcraft/parts/lifecycle.py", line 96, in run _expand_environment( File "/snap/snapcraft/12614/lib/python3.10/site-packages/snapcraft/parts/lifecycle.py", line 748, in _expand_environment info = craft_parts.ProjectInfo( File "/snap/snapcraft/12614/lib/python3.10/site-packages/craft_parts/infos.py", line 148, in __init__ self._project_vars = {k: ProjectVar(value=v) for k, v in pvars.items()} File "/snap/snapcraft/12614/lib/python3.10/site-packages/craft_parts/infos.py", line 148, in <dictcomp> self._project_vars = {k: ProjectVar(value=v) for k, v in pvars.items()} File "/snap/snapcraft/12614/lib/python3.10/site-packages/pydantic/main.py", line 193, in __init__ self.__pydantic_validator__.validate_python(data, self_instance=self) pydantic_core._pydantic_core.ValidationError: 1 validation error for ProjectVar value Input should be a valid string [type=string_type, input_value=20, input_type=int] For further information visit https://errors.pydantic.dev/2.8/v/string_type <--- After much scratching my head I noticed the "20" and then solved the problem by also editing version: "20" with quotes. Core24 was accepting version: 20 without quotes though.

Evaluation history

No evaluation history available.